﻿@using Kunlun.BusinessLogic;
@model IEnumerable<Kunlun.Models.Consumer_pic>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
<style>
body,div,a,img,p,form,h1,h2,h3,h4,h5,h6,input,textarea,ul,li,span{ margin:0; padding:0;border: 0;}
body{ color:#ffffff;  font-size:12px;font-family: 12px/1.5 Tahoma,Helvetica,Arial,'宋体',sans-serif; background-color:#ffffff;}
div{ width:640px ;margin:0 auto; padding-left:20px; padding-top:20px; position:relative;background-color:#665555;}
ul{width:640px; display:block;}
li{width:120px; height:120px; float:left; display:block; list-style:none;border: thin solid #CCCCCC;margin:10px;}
</style>
<script language="javascript">
    //等比缩放图片
    function DrawImage(ImgD, kw, kh) {

        var image = new Image();
        image.src = ImgD.src;
        if (image.height < image.width)//说明宽》高＝＝》以宽为标准
        {
            if (image.width > kw) {
                ImgD.width = kw;
                ImgD.height = (image.height * kw) / image.width;
                ImgD.style.marginTop = (kh - (image.height * kw) / image.width) / 2 + "px";
                ImgD.style.marginBottom = ImgD.style.marginTop;
            }
            else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        }
        else//以高为标准
        {
            if (image.height > kh) {
                ImgD.height = kh;
                ImgD.width = (image.width * kh) / image.height;
                ImgD.style.marginLeft = (kw - (image.width * kh) / image.height) / 2 + "px";
                ImgD.style.marginRight = ImgD.style.marginLeft;
            }
            else {
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        }
    }
</script>

<title> @ViewBag.UserName推荐!</title>
</head>
<body>
<div>
您的好友:<text>@ViewBag.UserName</text>
<ul>
@foreach (var item in Model)
    {
        <li>
        <img src="@WebLog.PhotoView@Html.DisplayFor(modelItem => item.ThumUrl)" onload="DrawImage(this,120,120)" />
        </li>
}

</ul>
 <ul style="clear:both"></ul>
 <a href="/Account/Register">点击注册</a>
</div>